package com.zjg.service;

import java.io.InputStream;

import com.zjg.bean.User;
import com.zjg.dao.RegisterDaoImp;
import com.zjg.dao.iface.RegisterDao;
import com.zjg.service.iface.RegisterService;

public class RegisterServiceImp implements RegisterService {
		RegisterDao rd=new RegisterDaoImp();
	@Override
	public boolean Register(User user,InputStream in) {
		boolean flag=false;
		int i=rd.register(user,in);
		rd.setAdmin(3,user.getId());
		if(i>0);
		{	
			flag=true;
		}
		return flag;
	}
	@Override
	public boolean CheckUserId(String userId) {
		boolean flag=false;
		if(rd.checkUserId(userId)==1) {
			flag=true;
		};
		return flag;
	}
	@Override
	public boolean CheckUserName(String userName) {
		boolean flag=false;
		if(rd.checkUserName(userName)==1) {
			flag=true;
		};
		return flag;
		
	}

}
